import { Layout, Header, Aside, Main, Footer } from "./layout";
import Col from "vant/lib/col";
import "vant/lib/col/index.css";
import Row from "vant/lib/row";
import "vant/lib/row/index.css";
import {
  SvgCheck,
  SvgSearch,
  SvgButton,
  SvgHome,
  SvgMore,
  SvgStar,
  SvgTheme,
  SvgThumbs,
  SvgShare,
  SvgLeft,
  SvgTips,
} from "./svg-icon";
import BoxCenter from "./box-center";
import SingleCenter from "./single-center";
import BoxSkin from "./box-skin";
import Button from "./button";
import Launch from "./launch";
import FootNav from "./foot-nav";
import Magazine from "./magazine";
import Columns from "./columns";

const components = {
  Layout,
  Header,
  Aside,
  Main,
  Footer,
  CRow: Row,
  CCol: Col,
  SvgCheck,
  SvgSearch,
  SvgButton,
  SvgHome,
  SvgMore,
  SvgStar,
  SvgTheme,
  SvgThumbs,
  SvgShare,
  SvgLeft,
  SvgTips,
  BoxCenter,
  SingleCenter,
  BoxSkin,
  Button,
  Launch,
  FootNav,
  Magazine,
  Columns,
};

const install = (app) => {
  Object.keys(components).forEach((key) => {
    if (key === "CRow" || key === "CCol") {
      app.component(key, components[key]);
    } else {
      app.component(components[key]["name"], components[key]);
    }
  });
};

const Mui = {
  install,
};

export default Mui;
